package cc.rengu.igas.bsps.common.enums;

/**
 * 商户风险类型枚举
 * Created by 王成 on 2018/6/15.
 */
public enum MchntRiskTypeEnum {
    CERT_NO("00", "身份证风险"),
    BANK_CARD("01", "银行卡风险"),
    BUSINESS_NO("02", "营业执照风险"),
    ;
    private String riskType;
    private String riskDesc;

    MchntRiskTypeEnum(String riskType, String riskDesc) {
        this.riskType = riskType;
        this.riskDesc = riskDesc;
    }

    public String getRiskType() {
        return riskType;
    }

    public void setRiskType(String riskType) {
        this.riskType = riskType;
    }

    public String getRiskDesc() {
        return riskDesc;
    }

    public void setRiskDesc(String riskDesc) {
        this.riskDesc = riskDesc;
    }

    /**
     * 将内部商户风险类型转换成支付宝的风险类型
     *
     * @param riskType 内部商户风险类型
     * @return 支付宝商户风险类型
     */
    public static String changeAliPayMchntRiskType(String riskType) {
        switch (riskType) {
            case "00":
                return "riskinfo_cert_no";
            case "01":
                return "riskinfo_bank_card_no";
            case "02":
                return "riskinfo_business_license_no";
            default:
                return null;
        }
    }
}
